package ifreecomm.nettyserver.bean;

/**
 * Created by wang on 2018/12/19.
 */

public class Heart {
    private int type;
    private Data   data;
    private double timestamp;
    private String sign;

    public Heart() {
    }

    public Heart(int type, Data data, double timestamp, String sign) {
        this.type = type;
        this.data = data;
        this.timestamp = timestamp;
        this.sign = sign;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public Data getData() {
        return data;
    }

    public void setData(Data data) {
        this.data = data;
    }

    public double getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(double timestamp) {
        this.timestamp = timestamp;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    @Override
    public String toString() {
        return "Heart{" +
                "type=" + type +
                ", data=" + data +
                ", timestamp=" + timestamp +
                ", sign='" + sign + '\'' +
                '}';
    }

    public  static class Data{
        private double timestamp;
        private boolean successed;
        private  float  code;

        public Data(double timestamp, boolean successed, float code) {
            this.timestamp = timestamp;
            this.successed = successed;
            this.code = code;
        }

        @Override
        public String toString() {
            return "Data{" +
                    "timestamp=" + timestamp +
                    ", successed=" + successed +
                    ", code=" + code +
                    '}';
        }

        public double getTimestamp() {
            return timestamp;
        }

        public void setTimestamp(double timestamp) {
            this.timestamp = timestamp;
        }

        public boolean isSuccessed() {
            return successed;
        }

        public void setSuccessed(boolean successed) {
            this.successed = successed;
        }

        public float getCode() {
            return code;
        }

        public void setCode(float code) {
            this.code = code;
        }
    }

}
